package sg.edu.nus.iss.vmcs.maintenance;

import java.awt.event.*;
import java.awt.*;

public class DrinkDisplayListener implements ActionListener {

	private MaintenanceController mCtrl;

	public DrinkDisplayListener(MaintenanceController mctrl) {
		mCtrl = mctrl;
	}

	public void actionPerformed(ActionEvent e) {
		Button btn;
		String cmd;
		int idx;

		btn = (Button) e.getSource();
		cmd = btn.getActionCommand();
		idx = Integer.parseInt(cmd);

		mCtrl.displayDrinks(idx);
	}

}